import request from '~/utils/resquest'

// 灯杆主列表
export const getAssetLampPostList = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/list',
    method: 'get',
    params
  })

// 新增灯杆 基础资料
export const addAssetLampPostInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/add',
    method: 'post',
    data: params
  })

// 编辑灯杆 基础资料 原内容
export const getAssetLampPostInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/view',
    method: 'get',
    params
  })

// 编辑灯杆 基础资料 提交
export const updateAssetLampPostInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/update',
    method: 'post',
    data: params
  })

// 编辑灯杆 地图位置
export const updateAssetLampPostMapLocation = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/updateAddress',
    method: 'post',
    data: params
  })

// 校验灯杆是否可删除
export const checkDeleteAssetLampPostInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/checkRemove',
    method: 'post',
    params
  })

// 删除灯杆
export const deleteAssetLampPostInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/remove',
    method: 'post',
    params
  })

// 所属灯杆
export const getLampPostSelectBoxListByKey = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/selectBoxListByKey',
    method: 'get',
    params
  })

// 根据灯杆类型 查灯杆规格型号
export const getDeviceModelByLampPostType = <T>(params: T) =>
  request({
    url: '/api/gxsaas-monitor/deviceModel/selectBoxList',
    method: 'get',
    params
  })

// 导出灯杆
export const exportAssetLampPostInfo = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/export',
    method: 'get',
    responseType: 'blob',
    ...payload
  })

// 导出灯杆表格模板
export const exportAssetLampPostExcelTemplate = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/export-template1',
    method: 'get',
    responseType: 'blob',
    params
  })

// 导入灯杆
export const importAssetLampPostExcel = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/import-excel-new',
    method: 'post',
    data: params
  })

// 批量更新
export const importAssetLampPostUpdateExcel = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lamppost/update-excel',
    method: 'post',
    data: params
  })

// 获取灯杆类型
export const getLampPostTypeSelectList = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/lampPostParam/selectBoxList',
    method: 'get',
    params
  })
